package com.example.service;

import com.example.mapper.JobSeekerMapper;
import com.example.mapper.RecruiterMapper;
import com.example.pojo.dto.BossDTO;
import com.example.pojo.entity.JobRecruiter;
import com.example.pojo.entity.JobSeeker;
import com.example.pojo.entity.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 小岁
 * @version 2023/10/5 23:20
 */
@Service
@Transactional
public class RecruiterServiceImpl implements RecruiterService{

    @Autowired
    private RecruiterMapper recruiterMapper;

    @Override
    public List<JobRecruiter> getByConcatPerson(String contactPerson) {

        return recruiterMapper.findByConcatPerson(contactPerson);
    }

    @Override
    public JobRecruiter login(String jrAccount) {
        return recruiterMapper.findByJrAccount(jrAccount);
    }

    @Override
    public JobRecruiter findByRecruiterId(Integer id) {
        return recruiterMapper.findByRecruiterId(1);
    }

    @Override
    public JobRecruiter findById(Integer id) {
        return recruiterMapper.findById(id);
    }

    @Override
    public JobRecruiter jrLogin(String telephone) {
        return recruiterMapper.findByJrTelephone(telephone);
    }

    @Override
    public int jrRegister(String username, String password, String telephone) {
        return recruiterMapper.TblSave(username,password,telephone);
    }

    @Override
    public int save(String jrName, String jrType, String companyName, String companyType, String companyAddress, Integer employeesQuantity) {


        return recruiterMapper.jrSave(jrName,jrType,companyName,companyType,companyAddress,employeesQuantity);
    }

    @Override
    public BossDTO findByRecruiter(Integer id) {

        BossDTO bossDTO = new BossDTO();
        JobRecruiter jobRecruiter = new JobRecruiter();

        bossDTO.setJrName(jobRecruiter.getJrName());
        bossDTO.setJrType(jobRecruiter.getJrType());
        bossDTO.setCompanyName(jobRecruiter.getCompanyName());

        return bossDTO;
    }

    @Override
    public List<JobRecruiter> selectAll() {
        return recruiterMapper.selectAll();
    }


}
